import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/homepage',
    children:[
        {path: '/product',component: () => import('../views/ProductView.vue')},
        {path: '/User',component: ()=>import('../views/UserView')},
        {path: '/productDetail',component: () => import('../views/ProductDetailView.vue')},
        {path: '/MessageBoard',component: () => import('../views/user/MessageBoard.vue')},
        {path: '/homepage',component: () => import('../views/Homepage.vue')},
        {path: '/AboutUs',component: () => import('../views/AboutUs.vue')},
        {path: '/login/register',component: ()=>import('../views/Register.vue')}

    ]
  },
    {path: '/login',component: ()=>import('../views/LoginView')},
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
